package CSS::Builder::Selector::Class;
use Moose;

with 'CSS::Builder::Roles::List';

# For style sheets used with HTML,
# authors may use the dot (.) notation as an alternative
# to the "~=" notation when matching on the "class" attribute.
# Thus, for HTML, "DIV.value" and "DIV[class~=value]" have the same meaning.
# The attribute value must immediately follow the ".". 
has 'class'         => ( isa => 'Any' , is => 'rw');

sub css {
      my $self = shift;
      
      my $selectors = $self->list;
      my $c = $self->docss($selectors->[0]);
      
      return '.' . $self->class . ($c ? $c : '');
}

1;